+2008-05-20 14:27:34 Tim Janik <timj@imendio.com>
+
+ * reverted recent unapproved changes by Yair Hershkovitz, regarding:
+ Bug 503071 – Application direction changes to right to left even if theres no translation.
+
2008-05-19 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c: (gdk_window_hide),
strcpy (msg, "keyboard label|");
g_strlcat (msg, tmp, 128);
- str = g_dgettext (GETTEXT_PACKAGE, msg);
+ str = dgettext (GETTEXT_PACKAGE, msg);
if (str == msg)
{
g_string_append (gstring, tmp);
{
/* Pass through dgettext if and only if msgid is nonempty. */
if (msgid && *msgid)
- return g_dgettext (domainname, msgid);
+ return dgettext (domainname, msgid);
else
return (gchar*) msgid;
}
element_name);
}
+/* This function is taken from gettext.h
+ * GNU gettext uses '\004' to separate context and msgid in .mo files.
+ */
static const char *
-_g_dpgettext (const char *domain,
- const char *msgctxt,
- const char *msgid)
+dpgettext (const char *domain,
+ const char *msgctxt,
+ const char *msgid)
{
size_t msgctxt_len = strlen (msgctxt) + 1;
size_t msgid_len = strlen (msgid) + 1;
msg_ctxt_id = g_alloca (msgctxt_len + msgid_len);
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
- msg_ctxt_id[msgctxt_len - 1] = '|';
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
- return g_dpgettext (domain, msg_ctxt_id, 0);
+ translation = dgettext (domain, msg_ctxt_id);
+
+ if (translation == msg_ctxt_id)
+ {
+ /* try the old way of doing message contexts, too */
+ msg_ctxt_id[msgctxt_len - 1] = '|';
+ translation = dgettext (domain, msg_ctxt_id);
+
+ if (translation == msg_ctxt_id)
+ return msgid;
+ }
+
+ return translation;
}
gchar *
const char *s;
if (context)
- s = _g_dpgettext (domain, context, text);
+ s = dpgettext (domain, context, text);
else
- s = g_dgettext (domain, text);
+ s = dgettext (domain, text);
return g_strdup (s);
}
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (contexts[i]->domain, "UTF-8");
#endif
- translated_name = g_dgettext (contexts[i]->domain, contexts[i]->context_name);
+ translated_name = dgettext (contexts[i]->domain, contexts[i]->context_name);
}
else
{
#include <glib/gi18n-lib.h>
#ifdef ENABLE_NLS
-#define P_(String) g_dgettext(GETTEXT_PACKAGE "-properties",String)
+#define P_(String) dgettext(GETTEXT_PACKAGE "-properties",String)
#else
#define P_(String) (String)
#endif
static guint gtk_main_loop_level = 0;
static gint pre_initialized = FALSE;
static gint gtk_initialized = FALSE;
-static gint gettext_initialized = FALSE;
static GList *current_events = NULL;
static GSList *main_loops = NULL; /* stack of currently executing main loops */
g_warning ("gtk_disable_setlocale() must be called before gtk_init()");
do_setlocale = FALSE;
-
- g_disable_setlocale ();
}
#ifdef G_PLATFORM_WIN32
static void
gettext_initialization (void)
{
- if (gettext_initialized)
- return;
- gettext_initialized = TRUE;
-
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, GTK_LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE "-properties", GTK_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
bind_textdomain_codeset (GETTEXT_PACKAGE "-properties", "UTF-8");
# endif
- g_i18n_init ();
#endif
}
if (translate != NULL && translate->func != NULL)
item->label = (* translate->func) (item->label, translate->data);
else
- item->label = g_dgettext (item->translation_domain, item->label);
+ item->label = dgettext (item->translation_domain, item->label);
}
}
{
gchar *domainname = data;
- return (gchar *)g_strip_context (msgid, g_dgettext (domainname, msgid));
+ return (gchar *)g_strip_context (msgid, dgettext (domainname, msgid));
}